<template>
	<view class="page">
		<view class="content" :style="{ 'background-image': 'url(' + bgimg + ')' }">
			<view class="top">
				<view class="left" @click="gotodaohan">
					导航
				</view>
				<view class="right" @click="gotoxiugai">
					<span> <u-icon name="home-fill" color="#ffffff" size="28"></u-icon>{{ stoname }}
					</span>
					<span>-切换</span>
				</view>
			</view>
			<view class="scroll">
				<view class="seroll-one">
					<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="150">
						<view class="scroll-view-item_H uni-bg-red" @click="gotoyuyue(stoid)">
							<view class="item">
								<view class="left">
									立即预约
								</view>
								<view class="right">
									<image src="../../static/icons/clock.png" mode=""></image>
								</view>
							</view>
						</view>
						<view class="scroll-view-item_H uni-bg-green">
							<view class="item">
								<view class="left" @click="gotoyuyue(stoid)">
									立即预约
								</view>
								<view class="right">
									<image src="../../static/icons/clock.png" mode=""></image>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
				<view class="seroll-two">
					<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="200">
						<view class="scroll-view-item_H uni-bg-red">
							<view class="item" @click="goleave()">
								<view class="left">
									我的服务
								</view>
								<view class="right">
									<image src="../../static/icons/myserver.png" mode=""></image>
								</view>
							</view>
						</view>
						<view class="scroll-view-item_H uni-bg-green">
							<view class="item" @click="gomycar()">
								<view class="left">
									我的
								</view>
								<view class="right">
									<image src="../../static/icons/user.png" mode=""></image>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
				<view class="seroll-thr">
					<scroll-view class="scroll-view_H" scroll-x="true" scroll-left="160">
						<view class="scroll-view-item_H">
							<view class="item" @click="gotoserver(stoid)">
								<view class="left">
									服务项目
								</view>
								<view class="right">
									<image src="../../static/icons/serverproduct.png" mode=""></image>
								</view>
							</view>
						</view>
						<view class="scroll-view-item_H">
							<view class="item" @click="gotoserver(stoid)">
								<view class="left">
									服务项目
								</view>
								<view class="right">
									<image src="../../static/icons/serverproduct.png" mode=""></image>
								</view>
							</view>
						</view>
					</scroll-view>
				</view>
			</view>
			<view class="circle"></view>
			<view class="circle1"></view>
			<view class="circle2"></view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			userData: [],
			openid: '',
			navbackground: {
				backgroundColor: '#272228',
			},
			bgimg: 'https://adjyxw.h1668.com/uploads/20231018/a8280a9eb708d043f37b9e36771766f5.jpg',
			stoid: 1,
			stoname: '',
			latitude: '',
			longitude: '',
		};
	},
	onLoad() {
		this.getAdimageList()
	
	},
	methods: {
		gotodaohan() {
			const latitude = this.latitude
			const longitude = this.longitude
			uni.openLocation({
				latitude: parseFloat(latitude),
				longitude: parseFloat(longitude),
				scale: 18
			})
		},
		gomycar() {
			uni.navigateTo({
				url: '/pagesB/cart_info/cart_info'
			})
		},
		gotoxiugai() {
			uni.redirectTo({
				url: '/pagesB/server/server1'
			})
		},
		goleave() {
			uni.reLaunch({
				url: '/pagesB/vipGrade/vipGrade', // 当前页面的路径
			})
		},
		gotoserver(id) {
			let item = {
				id: id,
				content: 0,
				typeid: 1
			};
			uni.navigateTo({
				url: '/pagesB/server/server2?item=' + encodeURIComponent(JSON.stringify(item))
			})
		},
		gotoyuyue(id) {
			let item = {
				id: id,
				content: 1,
				typeid: 1
			};
			uni.navigateTo({
				url: '/pagesB/server/server2?item=' + encodeURIComponent(JSON.stringify(item))
			})
		},
		getUserInfo() {
			this.openid = uni.getStorageSync('openid');
		},
		
		getAdimageList() {
			uni.request({
				url: uni.getStorageSync('URL') + 'home/Carpark/Carpark/servicebgimg',
				method: 'POST',
				header: {
					"X-Requested-With": "XMLHttpRequest"
				},
				dataType: 'json',
				success: (res) => {
					this.bgimg = res.data.data
				}
			});
		}
	},
	filters: {

	}
}
</script>

<style lang="scss">
.page {
	width: 100%;
	overflow-x: hidden;
}

.content {
	width: 100%;
	height: 100vh;
	background-repeat: no-repeat;
	background-size: 100% 100%;
	position: relative;

	.top {
		position: absolute;
		width: 100%;
		font-size: 18px;
		color: #fff;
		display: flex;
		justify-content: space-between;

		.left {
			margin-left: 15rpx;
		}

		.right {
			width: 90px;
			margin-right: 10rpx;
			display: flex;
		}
	}

	.scroll {
		position: absolute;
		top: 140px;
		height: 400px;
		width: 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		z-index: 100;

		.seroll-one,
		.seroll-two,
		.seroll-thr {
			height: 70px;

			.scroll-view_H {
				white-space: nowrap;
				width: 100%;

				.scroll-view-item_H {
					display: inline-block;
					width: 100%;
					height: 100%;

					.item {
						display: flex;

						.left {
							color: #fff;
							height: 70px;
							line-height: 70px;
							font-size: 25px;
							width: 82%;
							text-align: right;
							margin-right: 10px;
						}

						.right {
							width: 60px;
							height: 60px;
							border: 3px solid white;
							border-radius: 50%;
							display: flex;
							align-items: center;
							justify-content: center;

							image {
								width: 40px;
								height: 40px;
								object-fit: contain;
							}
						}
					}
				}
			}
		}
	}

	.circle {
		position: absolute;
		top: 150px;
		left: 190px;
		width: 400px;
		height: 400px;
		border-radius: 50%;
		border: 50px solid rgba(255, 255, 255, 0.3);
		// filter: blur(5px);
		z-index: 1;
	}

	.circle1 {
		position: absolute;
		top: 180px;
		left: 220px;
		width: 340px;
		height: 340px;
		border-radius: 50%;
		border: 10px solid #babbb5;
		filter: blur(1px);
		z-index: 2;
	}

	.circle2 {
		position: absolute;
		top: 190px;
		left: 230px;
		width: 320px;
		height: 320px;
		border-radius: 50%;
		border: 10px solid #ffffff;
		filter: blur(px);
		z-index: 3;
	}
}</style>